Repository navigation
feat(platform): flag repo runs whose PR data is incomplete - #282
Merged
Merged
Conversation
The pre-commit hook runs prettier on every staged TypeScript file, and these two were not in its format, so any change to them dragged unrelated reformatting along. Formatting them in a commit of their own keeps the next commit to the change itself. No behavior change. Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The engine now reports pr_enrichment_degraded when its PR read fell back to partial data, and the repo page showed such a run like a complete one. The two panels the issue asks to mark are exactly the ones a degraded run does not render: the flow card needs the flow metrics that degradation removes, and the merge badge hides when the strategy is unknown. An amber badge in the page header names the failed steps in its tooltip. prDegradedSteps reads the field defensively, since ingestion stores any payload shape; a Record keyed by PrReadStep makes the compiler require every step in both directions. es-ES falls back to en-US, as it already does for the merge-strategy badge. Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The tooltip said merge strategy is shown as unknown whatever step failed, while with only the reviews or basic step failed the page shows the real merge badge beside it. It now says the strategy is not classified when enrichment fails, calls the affected metrics missing or skewed rather than understated, and drops the promise that the next run recovers them. The PrReadStep type moves above the ReportMetrics doc comment, which it had detached from the interface. Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
When the PR reviews read degrades, the engine omits single_pass_rate and median_review_rounds from each acceptance_by_origin / acceptance_by_tool group. The org PR health and tool comparison aggregations multiplied those fields by a weight, so a missing value would have become NaN and poisoned the whole org-level number. Both fields are now optional and a group is only summed when the values are numbers, so the result equals that of a run without the group. Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…hboard The badge on the repo page was the only place a degraded PR read showed; the compare table and the org dashboard rendered such a run like a complete one. The compare table now shows an amber marker (with the same tooltip text, also as screen-reader text) per repo, read through prDegradedSteps from the repo_metric_summaries payload. The select falls back to the pre-023 column list when the view has no payload, so the table stays populated, just unmarked. The dashboard shows an amber note above the PR-driven panels listing the affected repos, computed from the payloads it already loads. es-ES falls back to en-US. Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The amber dot on the compare table only had a `title` on a non-focusable span, so keyboard and touch users could not learn what it meant. When at least one visible row is marked, a one-line legend under the table now shows the dot and the existing "PR data incomplete" text. The per-row `title` is dropped since the sr-only text already carries the detail. The pt-BR dashboard note said "no run mais recente"; every other pt-BR string says "execução". Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
3 tasks done
2 tasks done
cpenaforte-clickbus
requested review from
clickmatos,
lucastribioliclickbus and
trentas
October 5, 2026 19:25
Selecting payload->pr_enrichment_degraded makes repo_metric_summaries aggregate every run's payload, and it was requested by all callers (repos, ai-exposure, dashboard, compare). It is now an option that only the compare page turns on; other callers get pr_degraded_steps: []. The retry without the field now happens only when the error says the column is missing (code 42703, or a message naming payload), so a timeout is logged and surfaced instead of being silently masked. SummaryRow becomes an interface of the selected columns instead of Record<string, any>. Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Degraded steps showed as raw ids ("enrichment") in the repo badge and
the compare marker. They now go through a localized label
(repos.detail.prData.steps.*, en-US and pt-BR; es-ES falls back) via
formatPrSteps.
prDegradedSteps drops repeated steps, so a payload listing one twice no
longer prints it twice.
The dashboard note listed every degraded repo; it now names at most 5
and collapses the rest into "and N more" / "e mais N".
anyPrDataIncomplete was a one-line wrapper; the compare view checks
inline instead. The repo page comment claimed the flow and merge panels
are absent exactly when the read degraded, which is false when only
"basic" failed.
Refs #236
Assisted-by: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The amber marker and its legend only existed in the desktop table, so the md:hidden card stack gave no sign a repo's PR read degraded. The marker is now one component used by both layouts, and the legend sits below both so either one explains it. The dot gains a title (hover for sighted users) next to its sr-only text; the legend keeps the meaning off colour and off the tooltip. Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The amber dot is the only per-row cue on the compare page, and amber-500 sits near 2.1:1 on the light card, below the 3:1 WCAG 1.4.11 asks of it. The dot and its legend now use amber-600 on light (about 3.2:1) and keep amber-500 on dark (well above 3:1). The PR-data tooltip said merge strategy isn't classified "when enrichment fails"; the engine only skips it when enrichment fails for merged PRs, so the copy now says so, in both locales. Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The failed PR-read steps lived only in a hover title and screen-reader text, on the compare dot and on the repo-page badge, so touch and keyboard users could see that the read was incomplete but not where. The mobile compare card now shows the localized steps as muted text next to the dot, and the repo page shows them next to the badge. On the card the visible steps replace the dot's sr-only sentence, so screen readers read them once, after a short sr-only "PR data incomplete:" prefix. The card marker also drops its ml-2: the row already spaces its items with gap-2. The desktop table is unchanged. Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reason for the `as unknown as` cast in getOrgReposSummary sat two lines above the query, away from the cast it explains. The query result is now bound first and the cast returned on its own line, with the reason right above it. No behavior change. Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Renders the compare view with one degraded and one clean repo and checks what the last fixes changed: the mobile card shows the failed steps as text after an sr-only prefix, the full sentence stays screen-reader text only in the table, the card marker has no margin, and the dot is amber-600 with amber-500 only on dark. All four fail against the previous marker. Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed open list, or a failed enrichment or reviews pass for open PRs, leaves open-PR fields out of the run, and the engine's report caveat now says so. The tooltip on the PR-data badge and marker listed only flow, review and in-PR metrics; it now names open-PR metrics too, in both locales. Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed merged list omits the PR lifecycle fields (counts, time to merge, cycle time), and a partial read skews them. The engine's report caveat now says so; the PR-data tooltip mirrors it in both locales. Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The repo-page badge now has the failed steps as visible text beside it, yet kept a title with the same steps in a sentence. Screen readers may read a title as a description, so the steps could be announced twice. The title goes; the visible text carries the steps. Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The desktop compare table kept the failed PR-read steps in a hover title and screen-reader text only, so sighted keyboard users could not see them, and on the mobile card the steps sat inline with the truncating repo name, where a long list squeezed it. Both layouts now put the amber dot and the localized steps on a line of their own under the repo name. The dot and the steps are aria-hidden, carrying the full sentence as their hover title, and screen readers read that sentence once as sr-only text, in both layouts alike (the card's short sr-only prefix gives way to it). Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 tasks done
The label for the `fetch` step read "PR read" / "leitura de PRs", so the step sentence said "This run's PR read failed at: PR read." It now says "entire read" / "leitura inteira". Found in a manual end-to-end check. Refs #236 Assisted-by: Claude Code <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
4 tasks
fix(platform): make the PR-data marker readable on touch and keyboard
fix(platform): make the PR-data query opt-in and localize its steps
feat(platform): mark incomplete PR data on compare and dashboard
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contexto e Motivação
O engine passa a registrar no
metrics.jsonquando a leitura de PRs degradou (#281), mas a página do repositório mostra um run degradado igual a um completo. E os dois painéis que a #236 pede para marcar não existem justamente nesse run: o card de Flow Efficiency só aparece com as métricas de flow, que somem na degradação, e o badge de merge strategy some quando a estratégia éunknown.Resolver agora porque o dashboard mostra o run mais recente: sem marca, um único run degradado muda o que se vê do repositório sem explicação.
Refs #236
Mudanças
prettier --writeempage.tsxesrc/types/metrics.ts. O hook de pre-commit roda o prettier em todo.ts/.tsxcommitado, e esses dois não estavam no formato; isolar a reformatação deixa os commits seguintes só com a mudança. Para revisar a feature, olhe a partir do segundo commit.PrReadStepe o campopr_enrichment_degradedemsrc/types/metrics.ts.lib/pr-enrichment.ts—prDegradedStepslê o campo sem confiar nele: o payload chega de qualquer versão do CLI, e o que não for lista de passos conhecidos é ignorado. UmRecord<PrReadStep, true>faz o compilador exigir a lista completa nos dois sentidos.en-USept-BR. O tooltip só diz que a merge strategy não é classificada quando o passo que falhou é o enriquecimento, porque comreviewsoubasico badge de merge real aparece ao lado. Oes-EScai noen-US, como já acontece com o badge de merge strategy.Plano de Teste
npx vitest run tests/pr-enrichment.test.ts— o helper com o campo ausente, válido, com valores desconhecidos e fora de lista; e as strings nos dois idiomas — rodado em2f859e9: 6 passednpm run lint,npx tsc --noEmit,npm run test:coverage,npm run build— os passos do jobplatformdo CI — rodado em2f859e9: lint 0 erros,tscok,test:coverage407 passed, build okpr_enrichment_degradede ver o badge com os passos no tooltip; num run limpo, nenhum badge — verificado de ponta a ponta no topo da pilha (fix(platform): make the PR-data marker readable on touch and keyboard #293, em4911e6d, com o rótulo corrigido conferido depois em8e83ca4), que contém este PR: plataforma rodando sobre as migrações reais e um PostgREST, com payloads do engine em sete cenários de falha, no Playwright em desktop, celular (390 px), só teclado, leitor de tela, tema escuro, pt-BR, en-US e es-ES; lá os passos aparecem como texto visível ao lado do badge, que substituiu o tooltip (fix(platform): make the PR-data marker readable on touch and keyboard #293)A verificação roda fora da máquina de quem construiu: o job
platformdo CI (RFC 0029, PM-4).Impacto e Risco
title, como no badge de merge strategy ao lado. O PR seguinte acrescenta uma legenda acessível na comparação.Tamanho (RFC 0028 §2.4): 138 linhas — 39 de estilo e 99 da mudança —, faixa 51–250.
Plano de Rollback
git revertdo merge. Revertendo só os commits da mudança, fica a formatação, que é inócua.Referências
Autoria Assistida
🤖 Generated with Claude Code